package com.chinapost.util;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ComponentTagSupport;

import com.opensymphony.xwork2.util.ValueStack;

/**
 *  通过用户sessionInfo中是否包含指定的url来判断权限，是否输出标签中的内容
 * @author gdh
 *
 */

public class PermissionTag extends ComponentTagSupport{
	
	private static final long serialVersionUID = 1L;
	private String url;
	
	

	public String getUrl() {
		return url;
	}



	public void setUrl(String url) {
		this.url = url;
	}



	@Override
	public Component getBean(ValueStack value, HttpServletRequest request, HttpServletResponse response) {
		return new PermissionComponent(value,request);
	}



	@Override
	protected void populateParams() {
		PermissionComponent permission = (PermissionComponent)component;
		permission.setUrl(url);
		super.populateParams();
	}



	
	
}
